<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="/WEB-INF/tld/fn.tld" prefix="fn" %>
<%@ taglib uri="/WEB-INF/tld/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/tld/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/tld/core.tld" prefix="c" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBliC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<base href="<%=basePath %>" />
<link href="orderManager/css/login.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="orderManager/css/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="/script/My97DatePicker/WdatePicker.js"></script>
</head>

<body>
<form action="/flight/order.do?op=notApply" method="post">
<div id="page-container">
	  <div id="content"><div class="p16"><DIV class="tb-1">
  <table width="760" height="37">
	<tr>
		<td width="248" height="31" class="tdl">
		  <label>订单开始时间：</label>
		  <input id="startDate" size="15" name="startDate" class="Wdate" onfocus="WdatePicker({isShowWeek:true,maxDate:'%y-%M-%d'})" value="${order.startDate }" readonly="readonly" />		</td>
		<td width="246" class="tdl"><label>订单结束时间：</label>
		  <input id="endDate" size="15" name="endDate" class="Wdate" onfocus="WdatePicker({isShowWeek:true,maxDate:'%y-%M-%d',minDate:'#F{$dp.$D(\'startDate\')}'})" value="${order.endDate }" readonly="readonly"/></td>
		<td width="183" class="tdl"><label>状态：
		   <select name="status">
					<option value="">-所有订单-</option>
					<option value="0">等待支付</option>
					<option value="1">支付完成</option>
					<option value="2">出票完成</option>
					<option value="4">退款成功</option>

				</select>
				 <script type="text/javascript">
<!--		
			document.getElementById('status').value='${order.orderStatus}';
//-->
</script>
		</label></td>
	    <td width="63" class="tdl"><button class="button2" id="J_SearchOrders" type="submit">
		搜索</button></td>
	</tr>
	<!-- add -->
</table>
      </DIV></div>
	  <div id="listbb">
	  <div align="center">
        <table class="tablet" cellspacing="1" cellpadding="3" border="0">
          <tr>
            <td class="tdt" height="128">
              <div class="ckbh"><c:if test="${orders!=null&&fn:length(orders)>0}">
              <input type="checkbox" name="ckAll" id="ckAll" value="1"/></c:if></div>
              <div class="bbmc">订单编号</div>
              <div class="ddbh">起飞-到达</div>
              <div class="ddbh">航班日期</div>
              <div class="ddbh">航班号</div>
			  <div class="ttbh">状态</div>
              <div class="ddbh">订单总价</div>
              <div class="ddbh">订单日期</div>
              <div class="ttbh">操作</div></td>
          </tr>
          <c:if test="${orders!=null&&fn:length(orders)>0}">
          <logic:iterate id="order" name="orders" indexId="index">
          	<tr>
            <td width="731" height="66">
			<table cellpadding="0" cellspacing="0" width="740">
                <tr>
                  <td><input type="checkbox" id="ck${index}" name="ck" value="${order.orderNo}" />  </td>
                  <td width="133" height="58"><span class="black-text"><a href="#" class="ck">${order.orderNo }</a></span></td>
                  <td class="tdl" width="103"><bean:write name="order" property="depTime" format="HH:ss"/> ${order.scity}<br />
                  <bean:write name="order" property="arrTime" format="HH:ss"/> ${order.ecity}</td>
                  <td class="tdi" width="79"><bean:write name="order" property="depTime" format="yyyy-MM-dd"/></td>
                  <td class="tdi" width="94"><span class="tkcg">${order.flightNo }</span></td>
                  <td class="tdi" width="72"><span class="jg"><span class="STYLE2">出票完成</span></span></td>
                  <td class="tdi" width="88">¥
                  <bean:write name="order" property="orderTotal" format="#"/> 
                  </td>
                  <td class="tdi" width="90"><bean:write name="order" property="bookDate" format="yyyy-MM-dd HH:mm"/></td>
                  <td class="tdi" width="69"><a class="ck" href="#">查看</a></td>
                </tr>
            </table></td>
          </tr>
          </logic:iterate>
          </c:if>
          <c:if test="${orders!=null&&fn:length(orders)==0}">
          <tr>
          	<td colspan="9"  height="58"><h4>为搜索到相关信息</h4></td>
          </tr>
          </c:if>
	    </table>
      </div>
	</div>
	  <div id="xm">
	  <div id="hbfk"></div>
	   <div class="sabrosus">
  	    	<select name="page" onchange="javascript:document.forms[0].submit();">
  	    	<c:forEach var="t" begin="1" end="${page.totalPage}">
  	    	<option value="${t}" 
  	    	<c:if test="${page.pageIndex==t}">
  	    		selected="selected"
  	    	</c:if>
  	    	> 第${t}页</option>
			</c:forEach>
  	    	</select>
  	    </div>
  	    <div id="hbfk"></div>
  	  <div class="sabrosus" style="display: none"><span class="disabled">首页</span><span class="current">1</span><a href="#?page=2">2</a><a href="#?page=3">3</a>...<a href="#?page=199">下一页</a><a href="#?page=2">尾页</a><span class="abc">到第
  	    <input id="J_PageNum"  class="xminput" name="pageNum" />
  	    页
  	    <input name="Submit23" type="submit" class="buttonss" value="确定" />
  	    </span></div>
	  </div>
	  <div id="listbb">
	  <div align="center">
        <table class="tablet" style="width: 500px" cellspacing="1" cellpadding="3" border="0">
         <tr>
           <td colspan="2">邮寄费：10元；每张行程单收取 1 元手续费<label></label> </td>
          </tr>
          <tr>
           <td width="20%" style="text-align: right;">收件人</td>
           <td style="text-align: left;"><input name="item.name" id="name" value="" /></td>
          </tr>
          <tr>
           <td style="text-align: right;">联系电话</td>
           <td style="text-align: left;"><input name="item.phone" id="phone" maxlength="11" value="" /></td>
          </tr>
          <%-- <tr>
           <td style="text-align: right;">地区</td> 
           <td style="text-align: left;"><sclect name="province">
           <option value="">-请选择省份-</option>
                  	  				<option value="10010000" >北京市</option>
                  	  				<option value="11010000" >天津市</option>
                  	  				<option value="12000000" >河北省</option>
                  	  				<option value="13000000" >山西省</option>
                  	  				<option value="14000000" >内蒙古自治区</option>
                  	  				<option value="15000000" >辽宁省</option>
                  	  				<option value="16000000" >吉林省</option>
                  	  				<option value="17000000" >黑龙江省</option>
                  	  				<option value="18010000" >上海市</option>
                  	  				<option value="19000000" >江苏省</option>
                  	  				<option value="20000000" >浙江省</option>
                  	  				<option value="21000000" >安徽省</option>
                  	  				<option value="22000000" >福建省</option>
                  	  				<option value="23000000" >江西省</option>
                  	  				<option value="24000000" >山东省</option>
                  	  				<option value="25000000" >河南省</option>
                  	  				<option value="26000000" >湖北省</option>
                  	  				<option value="27000000" >湖南省</option>
                  	  				<option value="28000000" >广东省</option>
                  	  				<option value="29000000" >广西壮族自治区</option>
                  	  				<option value="30000000" >海南省</option>
                  	  				<option value="31010000" >重庆市</option>
                  	  				<option value="32000000" >四川省</option>
                  	  				<option value="33000000" >贵州省</option>
                  	  				<option value="34000000" >云南省</option>
                  	  				<option value="35000000" >西藏自治区</option>
                  	  				<option value="36000000" >陕西省</option>
                  	  				<option value="37000000" >甘肃省</option>
                  	  				<option value="青海省" >青海省</option>
                  	  				<option value="宁夏回族自治区" >宁夏回族自治区</option>
                  	  				<option value="新疆维吾尔自治区" >新疆维吾尔自治区</option>
                  	  				<option value="香港特别行政区" >香港特别行政区</option>
                  	  				<option value="澳门特别行政区" >澳门特别行政区</option>
          	        </select>  
           
           </sclect>
           <select name="city">-请选择城市-</select>
           </td>
          </tr>  --%>        
           <tr>
           <td style="text-align: right;">邮政编码</td>
           <td style="text-align: left;"><input maxlength="6" name="item.zip" id="zip" value="" /></td>
          </tr>
          <tr>
           <td style="text-align: right;">详细地址</td>
           <td style="text-align: left;"><input name="item.address" style="width: 98%" id="address" value="" /></td>
          </tr>
          <tr>
           <td style="text-align: right;">总金额</td>
           <td style="text-align: left;">共计 <label id="lab" style="font-weight: bolder; color: red; font-size: 18px">0</label> 元
           <input name="item.payTotal" id="payTotal" type="hidden" value="" /></td>
          </tr>          
          <tr>
           <td align="center" colspan="2"><input type="button" onclick="valForm()" value="提交" /></td>
          </tr>
	    </table>
	    <br/>
      </div>
	</div>
	<input type="hidden" name="item.orderNo" id="orders" readonly="readonly" style="width: 100%" />
	<script type="text/javascript">
<!--
var ck_state,orders='',count=0;
	$('input[name="ckAll"]').click(function(){
	orders='';
	count=0;
	var ck_state = $(this).attr('checked');
		$('input[name="ck"]').each(function(i){
			$(this).attr('checked',ck_state);
			if(ck_state==true){
			count=$('input[name="ck"]').length;
			orders+=$(this).val()+'^';
			}
		});
	orders=orders.substring(0,orders.lastIndexOf('^'));
	$('#lab').text(count+10);
	$('#payTotal').val(count+10);
	$('#orders').val(orders);
	});
	$('input[name="ck"]').click(function(i){
		orders='';
		count=0;
		$('input[name="ckAll"]').attr('checked',false);
		$('input[name="ck"]').each(function(i){
			$(this).attr('checked',ck_state);
			if($(this).attr('checked')==true){
			count+=1;
			orders+=$(this).val()+'^'
			}
		});
		orders=orders.substring(0,orders.lastIndexOf('^'));
		$('#lab').text(count+10);
		$('#payTotal').val(count+10);
		$('#orders').val(orders);
	});
	function valForm(){
		if($.trim($('#orders').val())==''){
			alert('请选择需要申请行程单的订单');
			return;
		}
		if($.trim($('#name').val())==''){alert('收件人不能为空');$('#name').focus();return;}
		if($.trim($('#phone').val())==''){alert('联系电话不能为空');$('#phone').focus();return;}
		if($.trim($('#zip').val())==''){alert('邮政编码不能为空');$('#zip').focus();return;}
		if($.trim($('#address').val())==''){alert('详细地址不能为空');$('#address').focus();return;}
		$("form:first").submit();
	}
//-->
</script>
	
	</div>
</div></form>
	</body>
</html>

